<template>
  <div class="config-containter">
    <el-form label-width="100px">
      <el-tabs v-model="tab">
        <el-tab-pane label="数据集绑定" name="dataset">
          <base-dataset-tab :designer="designer" :chart="chart"></base-dataset-tab>
        </el-tab-pane>
        <el-tab-pane label="选项" name="option">
          <base-option-tab :designer="designer" :chart="chart"></base-option-tab>
        </el-tab-pane>
        <el-tab-pane v-if="['line'].indexOf(chart.dataset.type)>=0" label="轴配置" name="axis">
          <base-axis-tab :designer="designer" :chart="chart"></base-axis-tab>
        </el-tab-pane>
      </el-tabs>
    </el-form>
  </div>
</template>

<script>
import baseDatasetTab from "./baseDatasetTab.vue";
import baseOptionTab from "./baseOptionTab.vue";
import baseAxisTab from "./baseAxisTab.vue";

export default {
  components: {
    baseDatasetTab,
    baseOptionTab,
    baseAxisTab
  },
  props: {
    // 设计器对象
    designer: {
      type: Object,
      default: () => {
        return {};
      }
    },
    // 图形数据对象
    chart: {
      type: Object,
      default: () => {
        return {
          dataset: {}
        };
      }
    }
  },
  data () {
    return {
      tab: "dataset"
    };
  }
};
</script>

<style lang="scss" scoped>
.config-container {
  padding-bottom: 20px;
  .el-form-item {
    margin-bottom: 5px;
  }
  ::v-deep .el-form--label-top .el-form-item__label {
    padding: 0 0 2px;
    line-height: 1.5;
  }
  ::v-deep .el-radio {
    margin-right: 10px;
  }
  ::v-deep .el-input__suffix {
    top: -5px;
  }
  .slash-box {
    ::v-deep .el-form-item__label {
      padding: 0 10px 0 0;
    }
    .slash-item {
      margin: 0 5px;
    }
    ::v-deep .el-input__inner {
      padding: 0 5px;
    }
  }
}
</style>
